package com.wits.platform.dto;

import java.io.Serializable;

public class MenuDTO implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -7291669599738948475L;

	private String MU_ID;
	
	private String MU_NAME;
	
	private String MU_ID_P;
	
	private String CHECKED;

	public String getMU_ID() {
		return MU_ID;
	}

	public void setMU_ID(String mU_ID) {
		MU_ID = mU_ID;
	}

	public String getMU_NAME() {
		return MU_NAME;
	}

	public void setMU_NAME(String mU_NAME) {
		MU_NAME = mU_NAME;
	}

	public String getMU_ID_P() {
		return MU_ID_P;
	}

	public void setMU_ID_P(String mU_ID_P) {
		MU_ID_P = mU_ID_P;
	}

	public String getCHECKED() {
		return CHECKED;
	}

	public void setCHECKED(String cHECKED) {
		CHECKED = cHECKED;
	}
	
	/**
	 * 授权调用
	 * @return
	 */
	public String toRightTree(){
		String pid ="1";
		boolean isParent=true;
		if(this.MU_ID_P!=null){
			isParent=false;
			pid=this.MU_ID_P;
		}
		StringBuilder str=new StringBuilder();
		str.append("{\"id\":\"").append(this.MU_ID)
			.append("\",\"name\":\"").append(this.MU_NAME)
		    .append("\",\"pId\":\"").append(pid)
		    .append("\",\"type\":\"menu")
		    .append("\",\"isParent\":").append(isParent)
		    .append(",\"checked\":").append(this.CHECKED)
		    .append("}");
		
		return str.toString();
	}
}
